package com.supreme.nettyapp.generalserver.socketserver;

import com.supreme.nettyapp.generalserver.socketserver.service.SocketServerService;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;
import javax.annotation.Resource;

@Component
@ConditionalOnProperty(prefix = "netty.socket-server", name = "enabled", havingValue = "true")
public class SocketServerStarter {

    @Resource
    private SocketServerService socketServerService;

    @PostConstruct
    public void socketServerStarter() {
        socketServerService.startNettyServer();
    }
}
